package com.bdqn.t350.ch06.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bdqn.t350.ch06.bean.User;

import java.util.List;

public interface UserService {
    List<User> selectList(QueryWrapper queryWrapper);

    IPage<User> selectPage(IPage<User> page, QueryWrapper queryWrapper);

    int insert(User user);

    int deleteById(int id);

    int updateById(User user);

    User selectById(int id);

    /**
     * 根据用户名查询，登录时使用
     *
     * @param usrName
     * @return
     */
    public User selectByName(String usrName);


    /**
     * 自定义条件多表分页
     *
     * @param page
     * @param user
     * @return
     */
    Page<User> listPageAssociation(Page<User> page, User user);
}
